var i_show = {};
	
	i_show = {
			
			elem_str : [],
			
			dom : '',
			
			fnInit : function(){
				
				_dom = this.dom;
	
				_child = _dom ? $(_dom).find("img") : "";
				
				for( var i = 0; _child[i] ; i++ ){
					
					var elem = {};
					
						elem.dom = _child[i];
						
						elem.size = i <= 2 ? i+1 : 5-i ;
				
						((i !=2)&& (elem.pos = i<2 ? 1 : 2))||(elem.pos = 3)
						
						this.elem_str.push(elem);
					
				}
				
				_elem_str = this.elem_str ;
				
				for(var j = 0; elem=_elem_str[j];j++){
					
					((j != 2) && (elem.n_elem = j <2 ? j+1 : j-1))|| (elem.n_elem = 5) ;
					
					elem.id = j;
				
				}
				
			
				return this;
			},
			
			fnStart :function(id){
				
				_id = id  ?  id : '';
				
				_dom = this.dom = document.getElementById(id);
				
				if(!_dom) return ;
				
				this.fnInit().fnAddEvent();
			
			},
			
			fnAddEvent : function(){
				
				var i = 0, _dom = '', _elem = '';
				
				var _this =this;
				
				var _elem_str = this.elem_str;
				while(_elem = _elem_str[i++]){
					_dom = _elem.dom;				
					$(_dom).bind("click",{_elem:_elem,_a_elem:_elem_str},_this.fnMove);
				}
			},
			
			fnMove : function(){
				var _elem = f_elem =  arguments[0].data._elem, flag = {},dom='',_a_elem = arguments[0].data._a_elem;
		
				if(!_elem || _elem.pos == 3) return ; 
				
				if(_elem.pos==1)
					$(_elem.dom).animate({left:"0px"},300);
				else{
					$(_elem.dom).animate({left:"850px"},300);
				}
				(function(){setTimeout(function(){
							
							var _z='',_p='',_s='',_w='',_h='',_l="",_t="";
							
								flag = {};
							
							
							function isE_OBJ(obj){ 
								for ( var name in obj ) { 
								return false; 
								} 
								return true; 
							};
										
							var _e_num=false;
							
							while(!isE_OBJ(_elem)){
								var Sid = '',id='';
								dom = _elem.dom;
								if(isE_OBJ(flag)){
									$(dom).css("z-index",3);
									$(dom).animate({width:"460px",height:"300px",left:"370px",top:"0px"},500);		
									flag.pos = _elem.pos;
									flag.size = _elem.size;
									_elem.pos = 3;
									_elem.size =3;
									sId = _elem.id;
									id = [_elem.n_elem,_elem.n_elem = 5][0];
									_elem = _a_elem[id];
									if(_elem.n_elem == 5) 
										_e_num =true;
								}else{
									_p = flag.pos;
									_s = flag.size;
									_w = _s == 1 ? "300px" : "380px";
									_h = _s == 1 ? "200px" : "240px";
									_z = _s;
									_t = (_s==1&&"56px") || (_s==2&&"35px") || (_s==2&&"0px");
									_l = ((_s==1&&_p==1)&&("224px"))  || ((_s==1&&_p==2)&&("687px")) ||  ((_s==2&&_p==1)&&("267px")) || ((_s==2&&_p==2)&&("558px"));
									$(dom).animate({width:_w,height:_h,top:_t,left:_l},500);
									$(dom).css("z-index",_z);
									flag.pos = _elem.pos;
									flag.size = _elem.size;
									_elem.pos = _p;
									_elem.size = _s;
									if(_elem.n_elem == 5){
										_elem.n_elem =sId;
										_pos  = _elem.pos == 1? 2: 1;
										for(var i =0;i<5;i++){
											if(( _a_elem[i].pos == _pos) && (_a_elem[i].size==2)){
													_a_elem[i].n_elem = sId;
											}
											if((_a_elem[i].pos == _elem.pos) && _e_num && (_a_elem[i].size ==1)){
													_a_elem[i].n_elem = _elem.id;
													
											}
										}
										
										break;
									} 
									_elem = _a_elem[_elem.n_elem];
									
								}	
								
							}													
							
				},300)})();
				
			}
	
	
}

$(function(){
	i_show.fnStart("img_show");
});